import requests from './requests'

export const reqLogin = (data) => {
  return requests({
    url: '/user/adminLogin',
    method: 'post',
    data: data,
  })
}

export const reqUserInfo = (data) => {
  return requests({
    url: '/user/admin/UserInfo',
    method: 'get',
    params: data,
  })
}

export const reqMenuList = () => {
  return requests({
    url: '/menu/getMenuList',
    method: 'get',
  })
}

export const reqParentMenu = () => {
  return requests({
    url: '/menu/getParentMenu',
    method: 'get',
  })
}

export const reqAddMenu = (data) => {
  return requests({
    url: '/menu/saveMenu',
    method: 'post',
    data: data,
  })
}

export const reqSavePermission = (data) => {
  return requests({
    url: '/perms/savePermsInfo',
    method: 'post',
    data: data,
  })
}

export const reqRolePerms = (data) => {
  return requests({
    url: '/role/getRolePermsList',
    method: 'get',
    params: data,
  })
}

export const reqPermission = (data) => {
  return requests({
    url: '/perms/getPermsList',
    method: 'get',
    params: data,
  })
}

export const reqSaveRolePerms = (data) => {
  return requests({
    url: `/role/updateRolePerms/${data.roleId}`,
    method: 'put',
    data: data.menuIds,
  })
}

export const reqPermsCategory = () => {
  return requests({
    url: '/perms/getPermsCategory',
    method: 'get',
  })
}

export const reqRolePag = (data) => {
  return requests({
    url: '/role/getRolePage',
    method: 'get',
    params: data,
  })
}

export const reqRoleMenu = (data) => {
  return requests({
    url: '/role/getRoleMenuList',
    method: 'get',
    params: data,
  })
}

export const reqSaveRoleMenu = (data) => {
  return requests({
    url: `/role/updateRoleMenu/${data.roleId}`,
    method: 'put',
    data: data.menuIds,
  })
}

export const reqUserPage = (data) => {
  return requests({
    url: '/user/admin/getUserInfoPage',
    method: 'get',
    params: data,
  })
}

export const reqUserMenu = (data) => {
  return requests({
    url: '/menu/admin/getUserMenu',
    method: 'get',
    params: data,
  })
}

export const reqUserRoleAndAll = (data) => {
  return requests({
    url: '/role/admin/getUserAndAllRole',
    method: 'get',
    params: data,
  })
}

export const reqSaveUserRole = (data) => {
  return requests({
    url: '/user/admin/saveUserRole',
    method: 'post',
    data: data,
  })
}

export const reqUserList = (data) => {
  return requests({
    url: '/user/admin/UserList',
    method: 'get',
    params: data,
  })
}

export const reqDashBoardCount = () => {
  return requests({
    url: '/count/admin/dashboard',
    method: 'get',
  })
}

export const reqFileList = (data) => {
  return requests({
    url: '/file/admin/getFileList',
    method: 'get',
    params: data,
  })
}

export const reqUpdateFile = (data) => {
  return requests({
    url: '/file/admin/updateFile',
    method: 'put',
    data: data,
  })
}

export const reqUdateFileStatus = (data) => {
  return requests({
    url: '/file/admin/updateStatus/' + data.status,
    method: 'put',
    data: data.list,
  })
}

export const reqUpdateMenu = (data) => {
  return requests({
    url: '/menu/update',
    method: 'put',
    data: data,
  })
}

export const reqUpdateRole = (data) => {
  return requests({
    url: '/role/update',
    method: 'put',
    data: data,
  })
}

export const reqInsertRole = (data) => {
  return requests({
    url: '/role/save',
    method: 'post',
    data: data,
  })
}

export const reqUpdateRoleStatus = (data) => {
  return requests({
    url: '/role/updateStatus/' + data.status,
    method: 'put',
    data: data.list,
  })
}

export const reqShareFileList = (data) => {
  return requests({
    url: '/fileShare/admin/list',
    method: 'get',
    params: data,
  })
}

export const reqUpdateShareFile = (data) => {
  return requests({
    url: '/fileShare/admin/updateShareFile',
    method: 'put',
    data: data,
  })
}

export const reqUpdateShareFileStatus = (data) => {
  return requests({
    url: '/fileShare/admin/updateStatus/' + data.status,
    method: 'put',
    data: data.list,
  })
}

export const reqSysConfigList = () => {
  return requests({
    url: '/sysConfig/list',
    method: 'get',
  })
}

export const reqUpdateSysConfig = (data) => {
  return requests({
    url: '/sysConfig/update',
    method: 'put',
    data: data,
  })
}

export const reqUpdatePerms = (data) => {
  return requests({
    url: '/perms/update',
    method: 'put',
    data: data,
  })
}

export const reqUpdatePermsCategory = (data) => {
  return requests({
    url: '/permsCategory/update',
    method: 'put',
    data: data,
  })
}

export const reqUpdateUserInfo = (data) => {
  return requests({
    url: '/user/admin/saveUser',
    method: 'put',
    data: data,
  })
}

export const reqUpdateUserStatus = (data) => {
  return requests({
    url: '/user/admin/updateUserStatus/' + data.status,
    method: 'put',
    data: data.list,
  })
}
export const reqCreateUser = (data) => {
  return requests({
    url: '/user/admin/createUser',
    method: 'post',
    data: data,
  })
}

export const reqSetUserFilePublic = (data) => {
  return requests({
    url: '/file/admin/updateFileComment',
    method: 'put',
    data: data,
  })
}

// 添加敏感词
export const reqPostsensitiveWord = (data) => {
  return requests({
    url: 'cloud/sensitiveword/save',
    method: 'post',
    data: data,
  })
}

// 获取敏感词
export const reqSensitivePage = (data) => {
  return requests({
    url: 'cloud/sensitiveword/list',
    method: 'get',
    params: data,
  })
}
// 更新敏感词
export const requpdateSenstiveWord = (data) => {
  return requests({
    url: 'cloud/sensitiveword/update',
    method: 'post',
    data: data,
  })
}

// 批量删除敏感词
export const reqdeleteSensitiveWord = (data) => {
  return requests({
    url: "cloud/sensitiveword/delete",
    method: "post",
    data: data
  })
}

// 获取评论列表
export const reqCommentList = (data) => {
  return requests({
    url: '/comment/admin/list',
    method: 'get',
    params: data,
  })
}
// 修改评论状态
export const requpdateComment = (data) => {
  return requests({
    url: '/comment/admin/changestatus',
    method: "post",
    data: data
  })
}

// 删除评论
export const reqdeleteComment = (data) => {
  return requests({
    url: '/comment/admin/delete',
    method: "post",
    data: data
  })
}

// 登录日志
export const reqGetLogList = (data) => {
  return requests({
    url: '/cloud/loginlog/getList',
    method: "get",
    params: data
  })
}

export const reqChatList = (data) => {
  return requests({
    url: '/chat/admin/list',
    method: "get",
    params: data
  })
}

export const reqUpdateChat = (data) => {
  return requests({
    url: '/chat/admin/update',
    method: "put",
    data: data
  })
}

export const reqUpdateChatStatus = (data) => {
  return requests({
    url: '/chat/admin/updateStatus/' + data.status,
    method: "put",
    data: data.list
  })
}

export const reqUpdateGroupStatus = (data) => {
  return requests({
    url: '/group/admin/updateStatus/' + data.status,
    method: "put",
    data: data.list
  })
}

export const reqUpdateGroup = (data) => {
  return requests({
    url: '/group/admin/update',
    method: "put",
    data: data
  })
}

export const reqGroupList = (data) => {
  return requests({
    url: '/group/admin/list',
    method: "get",
    params: data
  })
}

export const reqUpdateChatDetailStatus = (data) => {
  return requests({
    url: '/chatDetail/admin/updateStatus/' + data.status,
    method: "put",
    data: data.list
  })
}

export const reqUpdateChatDetail = (data) => {
  return requests({
    url: '/chatDetail/admin/update',
    method: "put",
    data: data
  })
}

export const reqContactsList = (data) => {
  return requests({
    url: '/contacts/admin/list',
    method: "get",
    params: data
  })
}

export const reqUpdateContactsStatus = (data) => {
  return requests({
    url: '/contacts/admin/updateStatus/' + data.status,
    method: "put",
    data: data.list
  })
}

export const reqUpdateContacts = (data) => {
  return requests({
    url: '/contacts/admin/update',
    method: "put",
    data: data
  })
}

export const reqChatDetailList = (data) => {
  return requests({
    url: '/chatDetail/admin/list',
    method: "get",
    params: data
  })
}

export const reqGetAllNoticeList = (data) => {
  return requests({
    url: '/notice/admin/getAllList',
    method: "get",
    params: data
  })
}

export const reqCreateNotice = (data) => {
  return requests({
    url: '/notice/admin/addNotice',
    method: "post",
    data: data
  })
}

export const reqUpdateNotice = (data) => {
  return requests({
    url: '/notice/admin/updateNotice',
    method: "put",
    data: data
  })
}

export const reqUpdateNoticeStatue = (data) => {
  return requests({
    url: '/notice/admin/updateStatue/' + data.status,
    method: 'put',
    data: data.list,
  })
}

export const reqGetFeed = (data) => {
  return requests({
    url: '/feedback/getAllList',
    method: 'get',
    params: data,
  })
}

export const reqUpdateFeedStatus = (data) => {
  return requests({
    url: '/feedback/updateStatus/' + data.status,
    method: 'put',
    data: data.list,
  })
}
